/**
 * by samsun
 */
var epc = {
	id : 'epc-panel',
	title : '业务流程视图',
	layout : 'border',
	closable:true,
	defaults : {
	
		bodyStyle : 'padding:15px'
	},
	items : [
	         {
	    tbar: [{xtype:'button',width:50,text:'返回',iconCls: 'return',handler:returnToEpcList}],
		region : 'center',
		autoScroll:true,
		border : false,
		contentEl : 'epcCanvas'
	} ]
};
function returnToEpcList(){
	
	  Ext.getCmp('content-panel').layout.setActiveItem('epc-list-panel');
	  showEpcList();
}


function showEpcContent(text) {
	
	    
		var epcStore = new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : 'showEpc.action?method=showEpc',
			method : 'post'
			
		}),
		reader : new Ext.data.JsonReader({
			root : "Epc",
			totalProperty : "totalEpc",
			id:"id"
	    }, [ {
	    	name:'id'
	    },{
			name : 'type'
		}, {
			name : 'name'
		},{
			name : 'participant'
		},{
			name : 'next'
		}])
	});
	

	
	epcStore.load({
		params : {
			text : text
		},
		callback: function(r, options, success) { 
		if (success == false) {  
		alert("加载数据失败，无对应数据或者系统出现异常！"); 
		}else{ 
			
			       
					var canvas=document.getElementById('epcCanvas');
					var ctx=canvas.getContext('2d');
					
					drawEpcModel(50,150,ctx,epcStore);

				
				}
		}
				}); 
		
	
	
	
	
}